#pragma once

#include <memory>
#include <string>

#include "msgq/msgq_adapter.h"
#include "serializer/msg_serializer.h"

template <typename MsgType> class Publisher {
public:
  using MsgPtr = std::shared_ptr<MsgType>;
  Publisher(const std::string &topic_name);
  ~Publisher();

  bool Publish(const MsgType &msg);
  bool Publish(const MsgPtr &msg);

private:
  MsgSerializer<MsgType> serializer_;
  std::string topic_name_;
  std::shared_ptr<MsgQ> msgq_;
};